<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>内容修改</title>
<link rel="stylesheet" type="text/css" href="template/admin.css"/>
<script type="text/javascript" src="template/images/jquery.js"></script>
<script type="text/javascript" src="template/images/ck_form.js"></script>
<script type="text/javascript" src="template/images/dialog-min.js"></script>
<link type="text/css" href="template/images/dialog/dialog.css" rel="stylesheet" />
<style type="text/css">
.color{ position:relative; width:21px; height:18px; float:left; margin-left:5px; display:inline}
.color span{display:block;width:21px; height:18px; background:url('template/images/color.gif') no-repeat left center;}
.color_table{position:absolute; left:21px; top:18px; border:1px solid #ccc;}
.table_td{border:1px solid #fff; font-style:oblique};
</style>
<script type="text/javascript">
$(document).ready(function(){
	$('.info_qh').find('ul li').click(function(){
		$index=$('.info_qh').find('ul li').index(this);
		$(this).addClass('on').siblings().removeClass('on');
		$('#tb').find('#table_div').eq($index).show().siblings().hide();
	});
	
	
	$('.color span').click(function(){
				$('#select_color').show().find('td').hover(function(){
					$(this).css({'border-color':'#fff'});
				},function(){
					$(this).css({'border-color':'#ccc'});
				}).click(function(){
					$color=$(this).css('background-color');
					$('.color').css({'background':$color});
					$('#title').css({'color':$color});
					$('#title_color').val($color);
					$('#select_color').hide();
				});
			});	
	
	$('#title_type').change(function(){
		$title_type=$(this).val();
		if($title_type==1){
			$('#title').css({'font-weight':'bold'});
			$('#title').css({'font-style':'normal'});
			$('#title').css({'text-decoration':'none'});
		}else if($title_type==2){
			$('#title').css({'font-style':'italic'});
			$('#title').css({'font-weight':'normal'});
			$('#title').css({'text-decoration':'none'});
		}else if($title_type==3){
			$('#title').css({'text-decoration':'underline'});
			$('#title').css({'font-weight':'normal'});
			$('#title').css({'font-style':'normal'});
		}else{
			$('#title').css({'font-weight':'normal'});
			$('#title').css({'font-style':'normal'});
			$('#title').css({'text-decoration':'none'});
		}
	});		
	
});

function ck_show_url(n,id){
	$ck=$(n).attr('checked');
	if($ck){
		$(id).show();
	}else{
		$(id).hide();
	}
}
//删除多图
function del_pic($pic,$n){
	if($pic==""){alert('不存在该图片,删除失败');return false;}
	$r_m='#pic_'+$pic;
	$($r_m).remove();
}

//处理相册alt
function change_alt(n,id){
	$text=$(n).prev('#alt').val();
	$(n).load('admin_ajax.php',{'action':'change_pic_alt','id':id,'val':$text},function($data){
		if($data){alert('修改完成');}
	})
}
</script>
<?php
	$tech_num = (count($tech_arr)-1);
	$show_tech = $tech_arr[rand(0,$tech_num)];
?>
<!--
<script type="text/javascript">

	$(document).ready(function(){
		$str = '<?php echo $show_tech;?>';
		$('#show_tech').html("<em>小提示：</em>"+$str).fadeIn('slow');
	});

</script>
-->
</head>

<body>
<div class="admin_position"><span>当前位置 > 修改内容</span><p id="show_tech" style="display:none"></p></div><!--位置-->

<div class="admin_fh"><a href="?action=content_list&lang=<?php echo $lang;?>&id=<?php echo $channel_id;?>">返回</a></div>
				
<div class="order_contain">
<form name="maininfo" method="post" action="admin_content.php" class="form" enctype="multipart/form-data">
<div class="order_main">
 <div class="info_qh" style="margin-top:20px;">
 <ul>
  <li class="on">基本设置</li>
  <li>高级设置</li>
 </ul>
 <div class="clear"></div>
</div>
<div id="tb">
 <div id="table_div" style="display:block">
 <table cellpadding="0" cellspacing="0" width="100%">
 	<thead>
		<tr><th style="width:20%">参数说明</th><th style="width:80%">参数值</th></tr>
	</thead>
	<tbody>
		<tr>
		  <td style="width:20%;text-align:center" class="w1">标题：</td><td style="width:80%">
		  <input name="title" title="标题" reg="[^0]" value="<?php echo $field_value['title'];?>" style="width:40%; float:left; <?php 
		  if($field_value['title_color']){ echo "color:".$field_value['title_color'].";";}
		  if($field_value['title_style']==1){
		   echo "font-weight:bold;";
		  }else if($field_value['title_style']==2){
		  	echo "font-style:italic;";
		  }else if($field_value['title_style']==3){
		  	echo "text-decoration:underline;";
		  }
		  ?>" id="title" />
		  <input name="title_color" id="title_color" value="<?php echo $field_value['title_color'];?>" type="hidden" />
		  <div class="color"><span></span>
<table id="select_color" width="100" class="color_table" style="display:none" border="0" cellpadding="0" cellspacing="0">
<tr style="background:#FFFFFF; border:0">
<td style="background:#0000CC;border:1px solid #CCCCCC; padding:2px 5px;">&nbsp;</td>
<td style="background:#00CC66;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
<td style="background:#00FFCC;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
<td style="background:#996699;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
<td style="background:#CC3333;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
</tr>
<tr style="background:#FFFFFF; border:0">
<td style="background:#C0C0C0;border:1px solid #CCCCCC; padding:2px 5px;">&nbsp;</td>
<td style="background:#808080;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
<td style="background:#333333;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
<td style="background:#FE0000;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
<td style="background:#FF00FE;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
</tr>
<tr style="background:#FFFFFF; border:0">
<td style="background:#FFCD00;border:1px solid #CCCCCC; padding:2px 5px;">&nbsp;</td>
<td style="background:#993400;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
<td style="background:#FFFFFF;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
<td style="background:#99CD00;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
<td style="background:#008002;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
</tr>
<tr style="background:#FFFFFF; border:0">
<td style="background:#00CCFF;border:1px solid #CCCCCC; padding:2px 5px;">&nbsp;</td>
<td style="background:#3366FF;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
<td style="background:#0000FE;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
<td style="background:#010080;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
<td style="background:#CDFFFF;border:1px solid #CCCCCC;padding:2px 5px;">&nbsp;</td>
</tr>
<tbody>
<tr style="background:#FFFFFF; border:0">
<td style="background:#000">&nbsp;</td><td style="background:#000">&nbsp;</td><td style="background:#000">&nbsp;</td><td style="background:#000">&nbsp;</td><td style="background:#000">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<select name="title_style" id="title_type" style="float:left; margin-left:5px; display:inline">
<option value="0" <?php if($field_value['title_style']==0){ echo 'selected="selected"';}?>>标题样式</option>
<option value="1" <?php if($field_value['title_style']==1){ echo 'selected="selected"';}?>>加粗</option>
<option value="2" <?php if($field_value['title_style']==2){ echo 'selected="selected"';}?>>斜体</option>
<option value="3" <?php if($field_value['title_style']==3){ echo 'selected="selected"';}?>>下划线</option>
</select><span name="easyTip">不能为空</span>
		  </td>
		</tr>
		<tr>
		<?php
		$filter=explode(',',$field_value['filter']);
		?>
		  <td style="width:20%;text-align:center" class="w1">标志：</td><td style="width:80%"><label for="f1"><input id="f1" name="filter[]" value="a" style="border:0; margin-top:3px;" type="checkbox" <?php if(in_array('a',$filter)){?>checked="checked"<?php }?> />头条</label><label for="f2"><input id="f2" type="checkbox" value="b" style="border:0; margin-top:3px;" name="filter[]" <?php if(in_array('b',$filter)){?>checked="checked"<?php }?> />推荐</label><label for="f3"><input id="f3" type="checkbox" value="c" style="border:0; margin-top:3px;" name="filter[]" <?php if(in_array('c',$filter)){?>checked="checked"<?php }?> />图片</label><label for="f4"><input id="f4" type="checkbox" value="g" style="border:0; margin-top:3px;" <?php if($field_value['is_url']){echo "checked=\"checked\"";}?> onclick="ck_show_url(this,'#g_url');" name="filter_g" />跳转</label></td>
		</tr>
		<tr id="g_url" <?php if($field_value['is_url']){ echo "style=\"\"";}else{echo "style=\"display:none\"";}?>>
		  <td style="width:20%;text-align:center" class="w1"><span title="勾选跳转,将会转入跳转网址" class="help">跳转网址：</span></td><td style="width:80%"><input name="g_url" value="<?php echo $field_value['url_add'];?>" style="width:20%" /></td>
		</tr>
		<!--<tr>
		  <td style="width:20%;text-align:center" class="w1">来源：<p style="color:#999999; font-weight:normal"></p></td><td style="width:80%"><input name="source" value="<?php echo $field_value['source'];?>" style="width:30%" /></td>
		</tr>
		<tr>
		  <td style="width:20%;text-align:center" class="w1">作者：<p style="color:#999999; font-weight:normal"></p></td><td style="width:80%"><input name="author" value="<?php echo $field_value['author'];?>" style="width:30%" /></td>
		</tr>-->
		<tr>
		  <td style="width:20%;text-align:center" class="w1">缩略图：</td><td style="width:80%">
<input name="thumb" value="<?php echo $field_value['tbpic'];?>" style="width:30%; display:block; float:left; margin-top:55px;" id="thumb" />
		  <p style="margin-top:55px;" class="admin_up_pic"><a href="#" id="content_pic">上传图片</a></p><span id="show_thumb" class="admin_show_pic"><a href="#" id="content_pic1"><img src="../upload/<?php if($field_value['tbpic']){echo $field_value['tbpic'];}else{ echo 'no_pc.gif';}?>"  height="120" width="120"/></a></span>
		  </td>
		</tr>
		<tr>
		  <td style="width:20%;text-align:center" class="w1"><span title="请选择发布栏目,使用频道模板的栏目不可发布" class="help"></span>发布栏目：</td><td style="width:80%">
		  <select name="category" id="cate" reg="[^0]">
		  <option value="">请选择栏目</option>
		  <?php get_post_catelist($lang,$channel_id,$cate);?>
		  </select><span name="easyTip">不能为空</span>
		  </td>
		</tr>
		<tr>
		  <td style="width:20%;text-align:center" class="w1"><span title="使用html编辑器时才能使用该功能" class="help"></span>html编辑器选项:</td><td style="width:80%"><label for="f5"><input id="f5" name="down_file" type="checkbox" style="border:0; margin-top:3px;" value="1"  checked="checked"/>下载网络图片</label><label for="f6"><input id="f6" name="first_pic" type="checkbox" style="boder:0; margin-top:3px;" value="1"  checked="checked"/>使用第一张图片作为缩略图</label><label for="f7"><input id="f7" name="pic_watermark" type="checkbox" style="border:0; margin-top:3px;" value="1"  checked="checked"/>图片是否加水印</label><label for="f8"><input id="f8" name="is_info" type="checkbox" style="border:0; margin-top:3px;" value="1"  checked="checked"/>提取一部分内容作为描述</label><p style="color:red">(编辑器功能只有字段名为content,字段类型为html编辑器的字段可以使用)</p></td>
		</tr>
		
		
		<?php
		echo content_fields($channel_id,$field_value,'true');
		?>
		
		</tbody>
	</table>
		</div>
		
		<div id="table_div" style="display:none">
		 <table cellpadding="0" cellspacing="0" width="100%" class="table_info1">
		<thead>
		<tr><th style="width:20%">参数说明</th><th style="width:80%">参数值</th></tr>
	</thead>
		<tbody>
		<tr>
		  <td style="width:20%;text-align:center" class="w1">页面关键字(SEO)：</td><td style="width:80%"><input name="key_words" value="<?php echo $field_value['keywords'];?>" style="width:50%" />使用,分割</td>
		</tr>
		<tr>
		  <td style="width:20%;text-align:center" class="w1">页面描述(SEO)：<p style="color:#999999; font-weight:normal"></p></td><td style="width:80%"><textarea name="info" style="width:50%; height:50px;"><?php echo $field_value['info'];?></textarea></td>
		</tr>
		<tr>
		  <td style="width:20%;text-align:center" class="w1"><span title="在模板中未使用target属性时才能使用该功能" class="help">新窗口打开：</span></td><td style="width:80%">
		  	<label for="f9"><input id="f9" name="is_open" type="radio" style="border:0" value="0" <?php if(!$field_value['is_open']){echo 'checked="checked"';}?> />否</label><label for="f10"><input id="f10" name="is_open" type="radio" style="border:0" value="1" <?php if($field_value['is_open']){echo 'checked="checked"';}?>/>是</label>
		  </td>
		</tr>
		<tr>
		  <td class="w1" style="width:20%;text-align:center">置顶:</td><td style="width:80%">
		  	<label for="f20"><input id="f20" name="top" type="radio" value="0" style="border:0"  <?php if($field_value['top']==0){?>checked="checked"<?php }?>/>否</label><label for="f21"><input id="f21" name="top" style="border:0" type="radio" value="1" <?php if($field_value['top']==1){?>checked="checked"<?php }?>/>是</label>
		  </td>
		</tr>
		<tr>
		  <td class="w1" style="width:20%;text-align:center">发布时间:</td><td style="width:80%"><input style="width:30%" value="<?php echo date('Y-m-d H:m:s',time());?>" name="updatetime" /></td>
		</tr>
		<tr>
		  <td class="w1" style="width:20%;text-align:center">生成设置:</td><td style="width:80%"><label for="f11"><input id="f11" type="radio" value="0" name="is_html" style="border:0" <?php if(!$_confing['web_html'][0]){echo "disabled=\"disabled\" checked=\"checked\"";}elseif(!$field_value['is_html']){ echo"checked=\"checked\"";}?> />生成html</label><label for="f12"><input id="f12" type="radio" value="1" name="is_html" style="border:0" <?php if(!$_confing['web_html'][0]){echo "disabled=\"disabled\"";}elseif($field_value['is_html']){ echo"checked=\"checked\"";}?> />动态浏览&nbsp;&nbsp;<?php if(!$_confing['web_html'][0]){echo "<span style=\"color:red\">需要生成html请到'站点设置'中开启该语言的'生成html'功能</span>";}else{}?></label></td>
		</tr>
		<tr>
		  <td class="w1" style="text-align:center"><span title="只能为字母、数字或_-组合" class="help">内容静态页名称:</span></td><td style="width:80%">
		  <input type="text" name="custom_url" style="width:20%" disabled="disabled" title="生成内容html使用，建议不要多次修改" value="<?php echo $field_value['custom_url'];?>"/>为空默认生成，不为空需要重新生成该栏目下的所有内容
		  </td>
		</tr>
		<tr>
		  <td class="w1" style="width:20%;text-align:center">缓存时间:</td><td style="width:80%"><input type="text" name="cache_time" style="width:100px" <?php if(!$_confing['is_cache'][0]){echo 'disabled="disabled"';}?> value="<?php if($field_value['cache_time']){echo $field_value['cache_time'];}else{echo $_confing['cache_time'];}?>" />秒<span style="color:#FF0000">只能动态页面使用</span></td>
		</tr>
		</tbody>
 </table>
 </div>
 </div>
 </div>
<div class="order_btn">
<input type="hidden" name="action" value="save_edit_content"/><input type="hidden" value="<?php echo $id;?>" name="id" /><input type="hidden" name="channel_id" value="<?php echo $channel_id;?>" /><input name="lang" value="<?php echo $lang;?>"  type="hidden"/><input type="hidden" name="addtime" value="<?php echo $field_value['addtime'];?>" />
  <input type="submit" value="确定" name="submit" /><input type="reset" style="margin:0 10px;" value="重置" name="reset"/>
 </div>
</form>
</div><!--内容切换-->

<div class="ie8-height"></div>

<script type="text/javascript">
$('#content_pic').wBox({title:'缩略图',requestType: "iframe",target:"admin_pic_upload.php?type=radio&get=thumb",iframeWH:{width:800,height:400}});
$('#content_pic1').wBox({title:'缩略图',requestType: "iframe",target:"admin_pic_upload.php?type=radio&get=thumb",iframeWH:{width:800,height:400}});
$('#content_lang').wBox({title:'选择其它语言',requestType: "iframe",target:"admin_lang_cate.php?id=<?php echo $id;?>&lang=<?php echo $lang;?>",iframeWH:{width:800,height:400}});

var $href;
$href = $('#more_pic').attr('href');

$('#more_pic').wBox({title:'缩略图',requestType: "iframe",target:$href,iframeWH:{width:800,height:400}});
$file_href = $('#upload_file').attr('href');
$('#upload_file').wBox({title:'附件',requestType: "iframe",target:$file_href,iframeWH:{width:800,height:400}});
</script>
</body>
</html>
